import  re
text = 'Hello Word! Hello coding!'
#替换
new_text = re.sub(r'Hello', 'Hi', text)
print(new_text)

#替换一个
new_text2 = re.sub(r'Hello', 'Hi', text,1)
print(new_text2)
